package com.example.springbook.service;

import com.example.springbook.Dao.BookDao;
import com.example.springbook.Mudel.BookInfo;

import java.util.List;

public class BookService {
    public List<BookInfo> getBookInfoList() {
        BookDao bookDao = new BookDao();
        List<BookInfo> bookInfos = bookDao.mockBookData();
        for (BookInfo bookInfo : bookInfos) {
            if (bookInfo.getState() == 1) {
                bookInfo.setStateCN("可借阅");
            }else {
                bookInfo.setStateCN("不可借阅");
            }
        }

        return bookInfos;
    }
}
